// GPUSolver成员函数包装实现
// 这些函数调用FastVectorOps.cu中的C风格函数

#include "GPUSolver.h"

// C风格GPU向量操作函数声明（在FastVectorOps.cu中实现）
extern "C" {
    int gpuVectorDot(int n, const double* d_x, const double* d_y, double* result);
    int gpuVectorAxpy(int n, double alpha, const double* d_x, double* d_y);
    int gpuVectorCopy(int n, const double* d_x, double* d_y);
    int gpuVectorScal(int n, double alpha, double* d_x);
    int gpuVectorNorm2(int n, const double* d_x, double* result);
}

// GPUSolver成员函数实现（简单包装C函数）

int GPUSolver::fastVectorDot(int n, const double* d_x, const double* d_y, double* result) {
    return gpuVectorDot(n, d_x, d_y, result);
}

int GPUSolver::fastVectorAxpy(int n, double alpha, const double* d_x, double* d_y) {
    return gpuVectorAxpy(n, alpha, d_x, d_y);
}

int GPUSolver::fastVectorCopy(int n, const double* d_x, double* d_y) {
    return gpuVectorCopy(n, d_x, d_y);
}

int GPUSolver::fastVectorScal(int n, double alpha, double* d_x) {
    return gpuVectorScal(n, alpha, d_x);
}

int GPUSolver::fastVectorNorm2(int n, const double* d_x, double* result) {
    return gpuVectorNorm2(n, d_x, result);
}
